<?php
/*
 * @Date: 2020-07-04 12:20:24
 * @名称: 
 * @描述: 
 * @版本: 0.01
 * @作者: 初雪桜
 * @邮箱: 202184199@qq.com
 * @最后编辑人: 初雪桜
 * @LastEditTime: 2020-07-24 23:19:13
 * @FilePath: /Pica_acg服务器/tiaoban.php
 * @最后编辑: 初雪桜
 */

$url = $_GET["url"];
$extension =  substr(strrchr($url, '.'), 1);
switch ($extension) {
    case 'png':
        $img = imagecreatefrompng(str_replace("https://", "http://", $url));
        if ($img) {
            header("Content-type:image/png");
            imagepng($img);
        } else {
            echo 'aadawdaw3';
        }
        break;

    default:
        $img = imagecreatefromjpeg(str_replace("https://", "http://", $url));
        if ($img) {
            header("Content-type:image/jpeg");
            imagejpeg($img);
        } else {
            echo 'aadawdaw2';
        }
        break;
}
 		
 		
 		/* header("Content-type:image/jpeg");
 		$img = imagecreatefromjpeg('http://b-ssl.duitang.com/uploads/item/201607/04/20160704052649_WLyfB.jpeg');
 		imagejpeg($img);
 		 */